package com.google.appengine.api.datastore;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;

/**
 *
 * @author Secondary User
 */
public interface AsyncDatastoreService
{

	public Future<Void> delete(Transaction txnRaw, Iterable<Key> keys);

	public PreparedQuery prepare(Transaction txnRaw, Query query);

	public Future<Transaction> beginTransaction(TransactionOptions options);

	public Future<KeyRange> allocateIds(String kind, long num);

	public Future<KeyRange> allocateIds(Key parent, String kind, long num);

	public Future<Void> delete(Key... keys);

	public Future<Void> delete(Iterable<Key> keys);

	public Future<Void> delete(Transaction txn, Key... keys);

	public Future<Entity> get(Key key);

	public Future<Map<Key, Entity>> get(Iterable<Key> keys);

	public Future<Entity> get(Transaction txn, final Key key);

	public Future<Map<Key, Entity>> get(Transaction txn, Iterable<Key> keys);

	public Collection<Transaction> getActiveTransactions();

	public Transaction getCurrentTransaction();

	public Transaction getCurrentTransaction(Transaction txn);

	public PreparedQuery prepare(Query query);

	public Future<Key> put(Entity entity);

	public Future<List<Key>> put(Iterable<Entity> entities);

	public Future<Key> put(final Transaction txn, final Entity entity);

	public Future<List<Key>> put(final Transaction txn, final Iterable<Entity> entities);

	public Future<DatastoreAttributes> getDatastoreAttributes();

	public Future<Map<Index, Index.IndexState>> getIndexes();

	public Future<Transaction> beginTransaction();
}
